//
//  LDButtonLine.m
//  指乎
//
//  Created by Dean on 2018/11/19.
//  Copyright © 2018 Dean. All rights reserved.
//

#import "LDButtonLine.h"

@implementation LDButtonLine

- (void)setBlueModel:(BOOL)blueModel {
    _blueModel = blueModel;
    if (_blueModel) {
        self.btLine.backgroundColor = GlobalBarTinColor;
        [self setTitleColor:GlobalBarTinColor forState:UIControlStateSelected];
    }else {
        [self setTitleColor:RGBA(253, 119, 0, 1) forState:UIControlStateSelected];
    }
}
- (instancetype)initWithFrame:(CGRect)frame{
    
    if (self = [super initWithFrame:frame]) {
        _btLine = [[UILabel alloc] initWithFrame:CGRectMake(0, self.height - 0.6, self.width, 0.6)];
        [self addSubview:_btLine];
        _btLine.backgroundColor = RGBA(204, 204, 204, 1);

    }
    return self;
}

- (void)setSelected:(BOOL)selected
{
    [super setSelected:selected];
    if (selected) {
        if (_blueModel) {
            _btLine.backgroundColor = GlobalBarTinColor;
        }else {
            _btLine.backgroundColor = RGBA(253, 119, 0, 1);
        }
    }else{
        _btLine.backgroundColor = RGBA(204, 204, 204, 1);
    }
    
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
